#!/usr/bin/env bash

# Path to this script
FILE="${BASH_SOURCE[0]}"
while [ -h "$FILE" ] ; do
  SRC="$(readlink "$FILE")"
  FILE="$( cd -P "$(dirname "$FILE")" && \
           cd -P "$(dirname "$SRC")" && pwd )/$(basename "$SRC")"
done
MAIN="$( cd -P "$(dirname "$FILE")/.." && pwd )"
CORE="$( cd -P "$MAIN/../basex-core" && pwd )"

# API, core, and library classes
CP=$MAIN/target/classes:$MAIN/lib/custom/*:$MAIN/lib/*:$CORE/lib/*:$CLASSPATH

# Run code
exec java -cp "$CP" $BASEX_JVM org.basex.BaseXHTTP "$@" stop
